package com.elibrary;

import android.app.ProgressDialog;
import android.os.AsyncTask;

/**
 * Created with IntelliJ IDEA.
 * User: Enkuso
 * Date: 1/21/13
 * Time: 10:02 AM
 * To change this template use File | Settings | File Templates.
 */
abstract class BaseTask extends AsyncTask<String, Void, Boolean> {

    ProgressDialog mDialog;

    @Override
    protected void onPreExecute() {
        super.onPreExecute();

        mDialog = new ProgressDialog(BookstoreApplication.getAppContext()); //taking object for progress dialog
        mDialog.setMessage("Please wait...");
        mDialog.show(); //Displaying progressDialog
    }

    @Override
    protected void onPostExecute(Boolean result) {
        super.onPostExecute(result);
        if (mDialog != null) {
            mDialog.dismiss();//close the progress Dialog
        }
    }
}
